import React from "react";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import router from "./router/router";
import { Button, ConfigProvider, Input, Space, theme } from "antd";
import { Spin } from "antd";
function App() {
  const [themes, setThemes] = React.useState(true);
  const aaa = () => {
    setThemes(!themes);
  };
  return (
    <div>
      <ConfigProvider
        theme={{
          // 1. 单独使用暗色算法
          algorithm: themes ? theme.defaultAlgorithm : theme.darkAlgorithm,

          // 2. 组合使用暗色算法与紧凑算法
          // algorithm: [theme.darkAlgorithm, theme.compactAlgorithm],
        }}
      >
        <Button type="primary" onClick={aaa}>
          <p>切换主题</p>
        </Button>

        <React.StrictMode>
          <RouterProvider router={router} />
          <div id="spin" style={{ display: "block" }}>
            <Spin fullscreen={true} />;
          </div>
        </React.StrictMode>
      </ConfigProvider>
    </div>
  );
}

export default App;
